﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPageContent.master" AutoEventWireup="false" CodeFile="Project.aspx.vb" Inherits="Setup_Project" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeaderPlaceHolder" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">





        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgProject">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgProject" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="MetroTouch"
        Transparency="20">
    </telerik:RadAjaxLoadingPanel>

        <br /><br />

        <telerik:RadGrid ID="rgProject" runat="server" GridLines="None" DataSourceID="odsProject"
            AllowAutomaticDeletes="True" AllowAutomaticInserts="True" 
            Width="100%" AllowAutomaticUpdates="True" AllowPaging="True"
            AutoGenerateColumns="False"  MasterTableView-Dir="<%$ Resources:SystemResource, HTMLDirectionality %>"
            GroupPanel-Text="<%$ Resources:MainGrid ,GroupPanelText %>" 
            CellSpacing="0">
            <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="ProjectNo"
                TableLayout="Fixed" DataSourceID="odsProject" HorizontalAlign="NotSet"
                NoMasterRecordsText="<%$ Resources:MainGrid , NoMasterRecordsText %>">
                <CommandItemTemplate>
                    <asp:ImageButton ID="ibtnInitInsert" CausesValidation="false" CommandName="InitInsert" runat="server"
                    ImageUrl="~/Design/images/Grid/AddRecord.gif" />
                    <asp:LinkButton ID="lbtnInitInsert" CausesValidation="false" runat="server" Font-Size="14px"
                        Text="<%$ Resources:MainGrid , AddNew %>" Visible="true" CommandName="InitInsert" />&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:ImageButton ID="ibtnEditSelected" CausesValidation="false" CommandName="EditSelected"
                        runat="server" ImageUrl="~/Design/images/Grid/Edit.gif" />
                    <asp:LinkButton ID="lbtnEditSelected" CausesValidation="false" runat="server" Font-Size="Medium"
                        Text="<%$ Resources:MainGrid , EditSelected %>" Visible="true" CommandName="EditSelected" />&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:ImageButton ID="ibtnDeleteSelected" CausesValidation="false" CommandName="DeleteSelected"
                        OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>" runat="server"
                        ImageUrl="~/Design/images/Grid/Delete.gif" />
                    <asp:LinkButton ID="lbtnDeleteSelected" Font-Size="Medium" CausesValidation="false"
                        OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>" runat="server"
                        Text="<%$ Resources:MainGrid , DeleteSelected %>" CommandName="DeleteSelected" />&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:ImageButton ID="ibtnRebindGrid" CausesValidation="false" CommandName="RebindGrid"
                        runat="server" ImageUrl="~/Design/images/Grid/Refresh.gif" />
                    <asp:LinkButton ID="lbtnRebindGrid" Font-Size="Medium" CausesValidation="false" runat="server"
                        Text="<%$ Resources:MainGrid , Refresh %>" CommandName="RebindGrid" />
                </CommandItemTemplate>
                
                <Columns>
                               
                    <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"  ButtonType="ImageButton">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
                    </telerik:GridEditCommandColumn>

                    <telerik:GridBoundColumn DataField="ProjectNo" meta:ResourceKey="gbcProjectNo" SortExpression="ProjectNo"
                        UniqueName="ProjectNo" Visible="true">
                    </telerik:GridBoundColumn>
                            
                    <telerik:GridBoundColumn DataField="ProjectDescAr" meta:ResourceKey="gbcProjectDescAr"
                        SortExpression="ProjectDescAr" UniqueName="ProjectDescAr" >
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"/>
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </telerik:GridBoundColumn>

                    <telerik:GridBoundColumn DataField="ProjectDescEn" meta:ResourceKey="gbcProjectDescEn"
                        SortExpression="ProjectDescEn" UniqueName="ProjectDescEn"  >
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </telerik:GridBoundColumn>

                    <telerik:GridBoundColumn DataField="Level" meta:ResourceKey="gbcLevel"
                        SortExpression="Level" UniqueName="Level" >
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </telerik:GridBoundColumn>
                                                         
                    <telerik:GridBoundColumn DataField="isbranch" meta:ResourceKey="gbcisbranch" SortExpression="isbranch"
                        UniqueName="isbranch" Visible="true">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"  />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"/>
                    </telerik:GridBoundColumn>

                    <telerik:GridButtonColumn UniqueName="DeleteColumn" ConfirmText="<%$ Resources:MainGrid , ConfirmDelete %>" ConfirmTitle="Confirm" ButtonType="ImageButton" CommandName="Delete" >
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
                    </telerik:GridButtonColumn>
                    
            </Columns>

            <EditFormSettings ColumnNumber="2" EditFormType="Template" CaptionDataField="BankID"  >
               
                   <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                    <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                    <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                        Width="100%" />
                    <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                    <EditColumn ButtonType="ImageButton"
                        UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                    </EditColumn>
                    <FormTableButtonRowStyle HorizontalAlign="Left" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                
                
              
              <FormTemplate>
              
              
              <table id="Table2" cellspacing="2" cellpadding="1" border ="0" rules="none" >
                                    
                  <tr style="margin-bottom:40px">
                  <td>
                        <%--<asp:Label ID="lblNewUser" Font-Bold="true" Font-Italic="true" runat="server" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "New User", "Update User") %>' SkinID="KeyLabel"></asp:Label>--%> 
                        
                  </td>
                  </tr>
                  <tr>
                  <td>
                       <asp:Label ID="lblManrtbProjectNo" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>" ></asp:Label>
                       <asp:Label ID="lblProjectNo" runat="server" meta:ResourceKey="lblProjectNo" SkinID="KeyLabel" ></asp:Label>
                       &nbsp;&nbsp;
                  </td>
                  <td>
                       <telerik:RadTextBox ID="rtbProjectNo" runat="server" Width="250px" 
                        Text='<%# Bind("ProjectNo") %>' Enabled='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "True", "False") %>' >
                       </telerik:RadTextBox> 
                       <asp:RequiredFieldValidator ID="rfvrtbProjectNo" runat="server" ControlToValidate="rtbProjectNo" Display="Dynamic" ErrorMessage="<%$ Resources:Controls, ErrorMessage %>" ValidationGroup="valEditMode"></asp:RequiredFieldValidator>
                       <asp:CustomValidator ID="CVProjectNo" runat="server" ForeColor="Red" ControlToValidate="rtbProjectNo" Display="Dynamic" ValidationGroup="valEditMode"
                        ValidateEmptyText="false" OnServerValidate="CVProjectNo_ServerValidate" ErrorMessage="<%$ Resources:Controls, Exists %>"></asp:CustomValidator> 
                   </td>
                   </tr>
                   <tr>
                  <td>
                       <%--<asp:Label ID="lblManrtbMobile" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>" ></asp:Label>--%>
                       <asp:Label ID="lblProjectDescAr" runat="server" meta:ResourceKey="lblProjectDescAr" SkinID="KeyLabel" ></asp:Label>
                        &nbsp;&nbsp;
                  </td>
                  <td>
                       <telerik:RadTextBox ID="rtbProjectDescAr" Width="250px" runat="server" 
                        Text='<%# Bind("ProjectDescAr") %>'>
                       </telerik:RadTextBox> 
                   </td>
                   <td>
                        <%--<asp:RequiredFieldValidator ID="rfvrtbMobile" runat="server" ControlToValidate="rtbMobile" ErrorMessage="<%$ Resources:Controls, ErrorMessage %>" ValidationGroup="valEditMode"></asp:RequiredFieldValidator>--%>
                   </td>

                  <td>
                       <%--<asp:Label ID="lblManrtbTel" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>" ></asp:Label>--%>
                       <asp:Label ID="lblrtbProjectDescEn" runat="server" meta:ResourceKey="lblProjectDescEn" SkinID="KeyLabel"></asp:Label>
                        &nbsp;&nbsp;
                  </td>
                  <td>
                       <telerik:RadTextBox ID="rtbProjectDescEn" Width="250px" runat="server" 
                        Text='<%# Bind("ProjectDescEn") %>'>
                       </telerik:RadTextBox> 
                   </td>

                   </tr>
                   <tr>

                   <td>
                       <asp:Label ID="lblLevel" runat="server" meta:ResourceKey="lblLevel" SkinID="KeyLabel"></asp:Label>
                        &nbsp;&nbsp;
                  </td>
                  <td>
                       <telerik:RadNumericTextBox MaxLength="1" ID="rntbLevel" Width="100px" runat="server" 
                        Text='<%# Bind("Level") %>'>
                        <NumberFormat DecimalDigits="0" />
                       </telerik:RadNumericTextBox> 
                   </td>

                   <td>     
                   </td>
                   
                  <td>
                        <asp:Label ID="lblisbranch" runat="server" meta:ResourceKey="lblisbranch" SkinID="KeyLabel"></asp:Label>
                        &nbsp;&nbsp;
                  </td>
                  <td>
                       <telerik:RadNumericTextBox MaxLength="1" ID="rntbisbranch" Width="100px" runat="server" 
                        Text='<%# Bind("isbranch") %>'>
                        <NumberFormat DecimalDigits="0" />
                       </telerik:RadNumericTextBox> 
                  </td>
                  
                  </tr>
                  <tr>
                   
                   <td colspan="6"> 
                    <div style="margin-top: 15px">
                        <telerik:RadButton ID="btnInsert" meta:ResourceKey="btnInsert" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "True", "False") %>'
                            runat="server" CommandName="PerformInsert" Icon-PrimaryIconCssClass="rbOk" ValidationGroup="ValEditMode">
                        </telerik:RadButton>
                        <telerik:RadButton ID="btnUpdate" meta:ResourceKey="btnUpdate" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "False", "True") %>'
                            runat="server" CommandName="Update" CausesValidation="true" ValidationGroup="ValEditMode"
                            Icon-PrimaryIconCssClass="rbOk">
                        </telerik:RadButton>
                        &nbsp;
                        <telerik:RadButton ID="btnCancel" meta:ResourceKey="btnCancel" runat="server" CausesValidation="False"
                            CommandName="Cancel" Icon-PrimaryIconCssClass="rbCancel">
                        </telerik:RadButton>
                    </div>
                   </td>
                 </tr>

        </table>
        
              </FormTemplate>                
   
                </EditFormSettings>

                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                            Font-Underline="False" HorizontalAlign="Center" Wrap="True"   />
                    </MasterTableView>
                    <ValidationSettings CommandsToValidate="PerformInsert,Update" ValidationGroup="valEditMode" />
                    <ClientSettings AllowDragToGroup="False">
                        <Scrolling AllowScroll="false" ScrollHeight="400px"   />
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>
                    <FilterMenu EnableTheming="True">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </FilterMenu>
                     <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                </telerik:RadGrid>


        <asp:ObjectDataSource ID="odsProject" runat="server" 
            DeleteMethod="QueryDatabase" InsertMethod="QueryDatabase" 
            SelectMethod="QueryDatabase" TypeName="DBProjectSP" 
            UpdateMethod="QueryDatabase">
            <DeleteParameters>
                <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
                <asp:Parameter DefaultValue="DeleteProject" Name="Operation" Type="String" />
                <asp:Parameter Name="ProjectNo" Type="String" />
                <asp:Parameter Name="ProjectDescAr" Type="String" />
                <asp:Parameter Name="ProjectDescEn" Type="String" />
                <asp:Parameter Name="Level" Type="String" />
                <asp:Parameter Name="isbranch" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
                <asp:Parameter DefaultValue="SaveProject" Name="Operation" Type="String" />
                <asp:Parameter Name="ProjectNo" Type="String" />
                <asp:Parameter Name="ProjectDescAr" Type="String" />
                <asp:Parameter Name="ProjectDescEn" Type="String" />
                <asp:Parameter Name="Level" Type="String" />
                <asp:Parameter Name="isbranch" Type="String" />
            </InsertParameters>
            <SelectParameters>
                <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
                <asp:Parameter DefaultValue="RtvProject" Name="Operation" Type="String" />
                <asp:Parameter Name="ProjectNo" Type="String" />
                <asp:Parameter Name="ProjectDescAr" Type="String" />
                <asp:Parameter Name="ProjectDescEn" Type="String" />
                <asp:Parameter Name="Level" Type="String" />
                <asp:Parameter Name="isbranch" Type="String" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
                <asp:Parameter DefaultValue="SaveProject" Name="Operation" Type="String" />
                <asp:Parameter Name="ProjectNo" Type="String" />
                <asp:Parameter Name="ProjectDescAr" Type="String" />
                <asp:Parameter Name="ProjectDescEn" Type="String" />
                <asp:Parameter Name="Level" Type="String" />
                <asp:Parameter Name="isbranch" Type="String" />
            </UpdateParameters>
        </asp:ObjectDataSource>





</asp:Content>

